
#include "MemberAccount.h"



MemberAccount::MemberAccount(){
    
}

MemberAccount::MemberAccount(string, string, string, int){
    
}

MemberAccount::~MemberAccount(){
    
}

string MemberAccount::getCustomerID(){
    
    return userID;
}

string MemberAccount::getCustomerName(){
    
    return userName;
}

string MemberAccount::getCustomerPassword(){
    
    return userPassword;
}

int MemberAccount::getRewardsPoints(){
    
    return rewardsPoints;
}

void MemberAccount::setCustomerID(string cid){
    
    userID = cid;
}

void MemberAccount::setCustomerName(string nme){
    
    userName = nme;
}

void MemberAccount::setCustomerPassword(string pwd){
    
    userPassword = pwd;
}
void MemberAccount::setRewardsPoints(int rp){
    
    rewardsPoints = rp;
}

void MemberAccount::login(){
    
    MemberAccount tempAccount;
        
        cin>>tempAccount;
        
        tempAccount.encryptLoginDetails(tempAccount);
    
    
}

void MemberAccount::logout(){
    
}

MemberAccount MemberAccount::encryptLoginDetails(MemberAccount& aAccount){
    
    //here the password will be encrypted and return to
    //MemberAccount::login
    
    return aAccount;
    
}

void MemberAccount::decryptLoginDetails(){
    
}

void MemberAccount::viewHotelReview(){
    
}

void MemberAccount::searchHotel(){
    
}

void MemberAccount::createHotelReview(){
    
}

void MemberAccount::viewHotelItem(){
    
}

void MemberAccount::requestReviewPermission(){
    
}

void MemberAccount::viewPermitedHotel(){
    
}

bool MemberAccount::verification(MemberAccount aMember){

    //To verify log in infomation
    
    return false;
}


bool MemberAccount::operator==(MemberAccount& bMember){
    
    MemberAccount aMember=*this;
    
    if(aMember.getCustomerID() == bMember.getCustomerID()){
        if(aMember.getCustomerName() == bMember.getCustomerName()){
            if(aMember.getCustomerPassword() == bMember.getCustomerPassword()){
                if(aMember.getRewardsPoints() == bMember.getRewardsPoints()){
                    return true;
                }
            }
        }
    }
        return false;
    
}

MemberAccount MemberAccount::operator=(MemberAccount& rAccount){
    
    MemberAccount lAccount=*this;
    
    lAccount.setCustomerID(rAccount.getCustomerID());
    lAccount.setCustomerName(rAccount.getCustomerName());
    lAccount.setCustomerPassword(rAccount.getCustomerPassword());
    lAccount.setRewardsPoints(rAccount.getRewardsPoints());
    
    return lAccount;
}

istream& operator>>(istream& in, MemberAccount& anAccount){
    
    string temp;
    
    cout<<"Please Enter Userid:";
    cin>>temp;
    anAccount.setCustomerID(temp);
    
    cin.clear();
    cin.ignore(100, '\n');
    
    cout<<"Please Enter Password:";
    cin>>temp;
    anAccount.setCustomerPassword(temp);
    
    
    return in;
}
